<admintpl file="header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">订单列表</a></li>
    </ul>

    <form method="post" class="js-ajax-forms well form-search" id="export_order" action="{:U('Order/lists')}">
        订单编号:
        <input type="text" name="order_sn" style="width: 120px;" value="{$formget.order_sn}" placeholder="">
        用户名:
        <input type="text" name="username" style="width: 120px;" value="{$formget.username}" placeholder="">
      昵称:
        <input type="text" name="nickname" style="width: 120px;" value="{$formget.nickname}" placeholder="">  
        下单时间: &nbsp;
        <input type="text" class="js-date" name="start_time" style="width: 100px;" value="{$formget.start_time}" placeholder="">&nbsp;
        至:&nbsp;
        <input type="text" class="js-date" name="end_time" style="width: 100px;" value="{$formget.end_time}" placeholder="">
        状态:
        <select name="status" style="width: 120px;">
            <option value="0">全部</option>
            {$statusOption}
        </select>
        付款时间: &nbsp;
        <input type="text" class="js-date" name="pay_timeStart" style="width: 100px; margin-top: 10px;" value="{$formget.pay_timeStart}" placeholder="">&nbsp;
        至:&nbsp;
        <input type="text" class="js-date" name="pay_timeEnd" style="width: 100px; margin-top: 10px;" value="{$formget.pay_timeEnd}" placeholder="">


        <input type="submit" style="margin-left: 5px;margin-top: 10px;" class="btn btn-primary" value="搜索"/>
        <!--<input type="button" style="margin-left: 5px;" class="btn btn-primary export_order" value="导出订单"/>-->

    </form>

    <table style="word-break:break-all;" class="table table-hover table-bordered table-list"
           id="menus-table">
        <thead>
        <tr>
            <th width="5%" >序号</th>
            <th width="8%" >订单号</th>
            <th width="8%" >用户名</th>
            <th width="5%" >用户昵称</th>
            <th width="5%" >订单总价</th>
            <th width="5%" >优惠金额</th>
            <th width="5%" >实付价格</th>
            <th width="5%" >运费</th>
            <th width="8%" >订单状态</th>
            <th width="5%" >支付方式</th>
            <th width="15%" >收货信息</th>
            <th width="8%" >支付时间</th>
            <th width="8%" >下单时间</th>
            <th width="10%" >操作</th>
        </tr>
        </thead>
        <tbody>
        {$lists}
        </tbody>
    </table>
    <div class="pagination">{$Page}</div>
</div>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">物流信息</h3>
    </div>
    <form action="{:U('Order/sendNum')}" method="post"
          class="form-horizontal js-ajax-form">
        <div class="modal-body">
            <table>
                <tbody>
                <tr>
                    <td>运单编号：</td>
                    <input type="hidden" name="order_id" class="id" value="">
                    <td><input type="text" name="logistics_number" value=""><span>&nbsp;*</span></td>
                </tr>
                <tr>
                    <td>承运公司：</td>
                    <td><input type="text" name="logistics_company" value=""><span>&nbsp;*</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button type="submit" class="btn btn-primary ">保存</button>
        </div>

</div>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/jsshowloading.js"></script>
<script>
    //-----------------------------------
     function prov(){
        var province = $('#province').val();
        if(province == '') {
            $('#city').html("<option value='' <if condition="($formget.hot eq '')">selected</if> >全部</option>");
            $('#country').html("<option value='' <if condition="($formget.hot eq '')">selected</if> >全部</option>");
        } else {
            $.post("{:U('Agent/Index/getCity')}",{province:province},function(data){
					
                $('#city').html("<option value='' <if condition="($formget.hot eq '')">selected</if> >全部</option>"+data.city);

            })
        }

    }

    function city_c(){

        var city = $('#city').val();
        if(city == '') {
            $('#country').html("<option value='' <if condition="($formget.hot eq '')">selected</if> >全部</option>");
        } else {
            $.post("{:U('Agent/Index/getcountry')}",{city:city},function(data){
                $('#country').html("<option value='' <if condition="($formget.hot eq '')">selected</if> >全部</option>"+data);

            })
        }

    }
    //-----------------------------------
    $('.add_ext').click(function () {
        var id = $(this).attr("name");
//        console.log(id);
        $(".id").val(id);
    });
    
    $('.export_order').click(function () {
        /*var form_data = Array();
        form_data.order_sn = $("#export_order :input[name='order_sn']").val();
        form_data.username = $("#export_order :input[name='username']").val();
        form_data.nickname=$("#export_order :input[name='nickname']").val();
        form_data.status = $("#export_order select[name='status']").val();
        form_data.start_time = $("#export_order :input[name='start_time']").val();
        form_data.end_time = $("#export_order :input[name='end_time']").val();
		form_data.pay_timeStart=$("#export_order :input[name='pay_timeStart']").val();
		form_data.pay_timeEnd=$("#export_order :input[name='pay_timeEnd']").val();*/
		var strData=$("#export_order").serialize();
        $.ajax({

            url: "{:U('Order/goods_export')}",
            dataType:"json",
            data:strData,
            type:'POST',
            async:true,
            beforeSend:function(){
				//
            },
            success:function(rst){
                if(rst.code == '210') {
                    alert(rst.msg);return;
                }
                //$("body").hideLoading();
//                alert(rst.url);
                document.location.href =(rst.url);

            },
            error: function(){
//                $("body").hideLoading();
                alert("错误");
            },

        });
    });



</script>
</body>
</html>